from selenium.webdriver.common.by import By

from common.Utils import BolgDriver

class BlogDetail:
    url = ""
    driver = ""
    def __init__(self):
        self.url = "http://8.137.19.140:9090/blog_detail.html?blogId=25533"
        self.driver = BolgDriver.driver
        self.driver.get(self.url)
    def BlogDeatilByLogin(self):
        # 查找博客标题、时间、内容和“编辑”“删除”按钮
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.right > div > div.title")
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.right > div > div.date")
        self.driver.find_element(By.CSS_SELECTOR,"#h2-u5728u8FD9u91CCu5199u4E0Bu4E00u7BC7u535Au5BA2")
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.right > div > div.operating > button:nth-child(1)")
        self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.right > div > div.operating > button:nth-child(2)")
        # 截图
        BolgDriver.getScreenShot()